//
//  ToutiaoModel.m
//  BobNews
//
//  Created by lanou3g on 16/5/5.
//  Copyright © 2016年 liu. All rights reserved.
//

#import "ToutiaoModel.h"
#import "ToutiaoImageModel.h"
#import "ToutiaoMulImgModel.h"
@implementation ToutiaoModel

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"id"]) {
        self.ID = value;
    }
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

+ (instancetype)modelWithDictionary:(NSDictionary *)dictionary {
    NSString *ads = dictionary[@"ads"];
    
    NSString *str = dictionary[@"imgnewextra"];
    if (!str) {
        ToutiaoImageModel *imageModel = [[ToutiaoImageModel alloc]init];
        [imageModel setValuesForKeysWithDictionary:dictionary];
        return imageModel;
    } else {
        ToutiaoMulImgModel *mulImageModel = [[ToutiaoMulImgModel alloc]init];
        [mulImageModel setValuesForKeysWithDictionary:dictionary];
        return mulImageModel;
    }
    return nil;
}

@end
